import json

data = {"name": "John", "age": 30, "city": "New York"}
json_str = json.dumps(data)
print(json_str)

loda_data = json.loads(json_str)
print(loda_data["name"])

with open("data.json", "w", encoding="utf-8") as file:
    data = {"name": "chirs", "age": 20, "city": "beijing"}
    json.dump(data, file, indent=4)

with open("data.json", "r", encoding="utf-8") as file:
    load_data = json.load(file)
    print(load_data)